{% load static %}
<nav class="navbar navbar-expand-lg navbar-light bg-light mb-3 justify-content-between">
    <a href="/" class="navbar-brand">
        <img src="{% static 'images/blog.jpeg' %}" alt="" width="70" height="70">灰灰博客
    </a>
    <!-- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button> -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item">
                <a class="nav-link" href="/blog">博客</a>
            </li>
            <li class="nav-item dropdown">
                <a href="javascript:;" class="nav-link dropdown-toggle" id="navbarDropdown" role="button"
                    data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    学习视频
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                    {% for i in videos_kinds_name %}
                    <a href="{% url 'listvideos-url' i.id %}" class="dropdown-item">{{ i }}</a>
                    {% endfor %}
                </div>
            </li>

            
        </ul>
    </div>

    <div class="btn-group" role="group">
        <a href="/category/O" class="btn btn-secondary">原创</a>
        <a href="/category/R" class="btn btn-secondary">转载</a>
    </div>
    <form action="/search" class="form-inline" method="GET">
        <input type="search" class="form-control mr-sm-2 ml-2" placeholder="输入文章标题" aria-label="Search" name="title">
        <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button>
    </form>
    <a href="/article/edit" class="btn btn-success ml-2">发表文章</a>
    <!-- <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            {% if user.is_authenticated %}
                <div class="dropdown ml-2">
                    <a class="btn btn-secondary dropdown-toggle" role="button" id="dropdownMenuLink" aria-haspopup="true" aria-expanded="false">
                        {{ user.username }}
                    </a>
                    <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                        <a href="#" class="dropdown-item">个人中心</a>
                        <a href="/my_blog" class="dropdown-item">我的博客</a>
                        <a href="/my_article" class="dropdown-item">管理博客</a>
                        <a href="#" class="dropdown-item">帮助</a>
                        <a href="/logout" class="dropdown-item">退出</a>
                    </div>
                </div>
            {% else %}
                <div class="btn-group ml-2 " role="group">
                    <a href="/signin" class="btn btn-primary">登录</a>
                    <a href="/signup" class="btn btn-danger">注册</a>
                </div>
            {% endif %}
        </ul>
    </div> -->
    {% if user.is_authenticated %}
                <div class="dropdown ml-2">
                    <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown">
                        {{ user.username }}
                    </button>
                    <div class="dropdown-menu">
                        <a href="#" class="dropdown-item">个人中心</a>
                        <a href="/my_blog" class="dropdown-item">我的博客</a>
                        <a href="/my_article" class="dropdown-item">管理博客</a>
                        <a href="#" class="dropdown-item">帮助</a>
                        <a href="/logout" class="dropdown-item">退出</a>
                    </div>
                </div>
            {% else %}
                <div class="btn-group ml-2 " role="group">
                    <a href="/signin" class="btn btn-primary">登录</a>
                    <a href="/signup" class="btn btn-danger">注册</a>
                </div>
            {% endif %}
</nav>